package com.qqla;


import com.qqla.socket.WebSocketServer;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.socket.config.annotation.EnableWebSocket;

@EnableTransactionManagement // 开启事物注解
@EnableConfigurationProperties
@SpringBootApplication
@EnableWebMvc // 解决版本springboot 和 swagger版本问题
public class BokApplication {
    public static void main(String[] args) {
        ConfigurableApplicationContext context = SpringApplication.run(BokApplication.class, args);
        //这段是关键的。在启动时给websocket的ApplicationContext容器注入
        WebSocketServer.setApplicationContext(context);
    }
}
